// 导入自己封装的axios实例对象
import request from '@/utiles/request'
// 导入仓库实例 拿到token值
// import store from '@/store'

// 登录请求
export const Login = data => {
    return request({
        url: '/v1_0/authorizations',
        method: 'POST',
        data
    })
}

// 获取验证码
export const getSms = data => {
    return request({
        url: '/v1_0/sms/codes/' + data,
        method: 'GET',

    })
}

// 获取用户资料
export const getuserInfo = () => {
    return request({
        url: '/v1_0/user',
        // headers: {
        //     Authorization: 'Bearer ' + store.getters.token
        // }
    })
}


// 关注用户
export const addFollow = data => {
    return request({
        url: '/v1_0/user/followings',
        method: 'POST',
        data
    })
}


// 取消关注用户
export const deleteFollow = target => {
    return request({
        url: '/v1_0/user/followings/' + target,
        method: 'DELETE',

    })
}
